interface LoginAPIData {
  login_type: 'wechat'
  code: string
  iv: string
  encryptedData: string
}

interface LoginAPIResData {
  code: number
  data: {
    userinfo: UserInfo
  }
  errMsg: string
  errno: undefined
  profile: undefined
  status: number
  statusText: string
}

/**
 * @description 微信一键登录
 */
export function loginAPI(data: LoginAPIData) {
  return httpInstance.post<LoginAPIResData, LoginAPIData>(
    '/api/user/login',
    data,
  )
}
